package queries;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class MainFrame extends JFrame{
	public MainFrame(){
		this.setBounds(100, 50, 600, 400);
		this.setTitle("Main Frame");
		JButton but1 = new JButton("Enter new patient information");
		JButton but2 = new JButton("Enter patient id and testname to get the recommended medicine");
		JButton but3 = new JButton("Enter patient id to get patient's test");
		JButton but4 = new JButton("Enter patientid to delete patient");
		JButton but5 = new JButton("Enter patient's info and test result");
		JButton but6 = new JButton("Enter patient infor to update patient contact");
		this.setLayout(null);
		JLabel background=new JLabel(new ImageIcon("back.jpg"));
		background.setBounds(0, 0, 600, 400);
		this.add(background,-1);
		but1.setBounds(100, 50, 400, 30);
		but2.setBounds(100, 100, 400, 30);
		but3.setBounds(100, 150, 400, 30);
		but4.setBounds(100, 200, 400, 30);
		but5.setBounds(100, 250, 400, 30);
		but6.setBounds(100, 300, 400, 30);
		this.add(but1,0);
		this.add(but2,0);
		this.add(but3,0);
		this.add(but4,0);
		this.add(but5,0);
		this.add(but6,0);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);
		but1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				new Query1();
			}
		});
		but2.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				new Query2();
			}
		});
		but3.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				new Query3();
			}
		});
		but4.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				new Query4();
			}
		});
		but5.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				new Query5();
			}
		});
		but6.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				new Query6();
			}
		});
	}
}
